class Book {
    String name, editor, publisher;
    int date;

    public Book(String name, String editor, String publisher, int date) {
        this.name = name;
        this.editor = editor;
        this.publisher = publisher;
        this.date = date;
    }

    public void setName() {
        this.name = name;
    }

    public void setEditor(String editor) {
        this.editor = editor;
    }

    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    public void setDate(int date) {
        this.date = date;
    }

    public String getName() {
        return this.name;
    }

    public String getEditor() {
        return this.editor;
    }

    public String getPublisher() {
        return this.publisher;
    }

    public int getDate() {
        return this.date;
    }


    public String toString() {
        return "Book [书名=" + name + ", 作者=" + editor + ", 出版社=" + publisher + ", 出版日期=" + date + "]";
    }


    public boolean equals(Object obj) {
        if (!(obj instanceof Book)) {
            return false;
        }
        Book book = (Book) obj;
        if (!getName().equals(book.getName())) {
            return false;
        }
        if (!getEditor().equals(book.getEditor())) {
            return false;
        }
        if (!getPublisher().equals(book.getPublisher())) {
            return false;
        }
        if (!(getDate() == book.getDate())) {
            return false;
        }
        return true;
    }
}